<?php
class EventDispatcher {
	function __construct(array $config) {
		$this->setup($config);
	}

	private function setup($config) {
		foreach($config as $event=>$handler){
			if(is_array($handler)){
				include_once($handler[0].'.php');
			}
			AddEventHandler('iblock', $event, $handler);
		}
	}
}
